/**
 * kl yy-ds @2021
 */
package com.cxps.cloud.utils;

import java.time.LocalDate;
import java.util.Date;

/**
 * 单号工具类
 * @author YouCai.Liu
 * @since 2021/11/2
 * ...
 */
public class NumUtil {

    public static String getNum(){
        String replace = LocalDate.now().toString().replace("-", "");
        long time = new Date().getTime();
        return replace + time;
    }

    /**
     * 唯一号：年月日+随机8位 》 20201107 + 34001233
     * @return
     */
    public static String unique(){
        String replace = LocalDate.now().toString().replace("-", "");
        String uniqueId = IdUtils.generateId();
        String subStr = uniqueId.substring(uniqueId.length() - 8, uniqueId.length());
        return replace + subStr;
    }

}
